﻿using System;
using System.Collections.Generic;
using BusinessObjects.BusinessRules;

namespace BusinessObjects.BussinessVoucher
{
    /// <summary>
    /// 
    /// </summary>
    public class ItemTransaction :BusinessObject
    {

        /// <summary>
        /// Initializes a new instance of the <see cref="ItemTransaction"/> class.
        /// </summary>
        public ItemTransaction()
        {
            AddRule(new ValidateId("RefId"));
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="ItemTransaction"/> class.
        /// </summary>
        /// <param name="refId">The reference identifier.</param>
        /// <param name="unitId">The unit identifier.</param>
        /// <param name="taxCode">The tax code.</param>
        /// <param name="totalAmountTax">The total amount tax.</param>
        /// <param name="refTypeId">The reference type identifier.</param>
        /// <param name="refNo">The reference no.</param>
        /// <param name="refDate">The reference date.</param>
        /// <param name="customerId">The customer identifier.</param>
        /// <param name="vendorId">The vendor identifier.</param>
        /// <param name="trader">The trader.</param>
        /// <param name="stockId">The stock identifier.</param>
        /// <param name="totalAmountOc">The total amount oc.</param>
        /// <param name="journalMemo">The journal memo.</param>
        /// <param name="documentInclude">The document include.</param>
        /// <param name="itemTransactionDetails">The item transaction details.</param>
        public ItemTransaction(long refId, long unitId, string taxCode, decimal totalAmountTax, int refTypeId, string refNo, DateTime refDate, int? customerId, int? vendorId, string trader, int stockId, decimal totalAmountOc, string journalMemo, string documentInclude, List<ItemTransactionDetail> itemTransactionDetails, int accountingObjectType, bool isCalculatePrice)
        {
            RefId = refId;
            RefTypeId = refTypeId;
            RefNo = refNo;
            RefDate = refDate;
            CustomerId = customerId;
            VendorId = vendorId;
            Trader = trader;
            StockId = stockId;
            TotalAmountOc = totalAmountOc;
            JournalMemo = journalMemo;
            DocumentInclude = documentInclude;
            UnitId = unitId;
            TaxCode = taxCode;
            TotalAmountTax = totalAmountTax;
            ItemTransactionDetails = itemTransactionDetails;
            AccountingObjectType = accountingObjectType;
            IsCalculatePrice = isCalculatePrice;
        }
        /// <summary>
        /// Gets or sets the reference identifier.
        /// </summary>
        /// <value>
        /// The reference identifier.
        /// </value>
        public bool IsCalculatePrice { get; set; } 
        /// <summary>
        /// Gets or sets the type of the accounting object.
        /// </summary>
        /// <value>
        /// The type of the accounting object.
        /// </value>
        public int? AccountingObjectType { get; set; }
        /// <summary>
        /// Gets or sets the reference identifier.
        /// </summary>
        /// <value>
        /// The reference identifier.
        /// </value>
        public long UnitId { get; set; } 

        /// <summary>
        /// Gets or sets the reference identifier.
        /// </summary>
        /// <value>
        /// The reference identifier.
        /// </value>
        public long RefId { get; set; }

        /// <summary>
        /// Gets or sets the reference type identifier.
        /// </summary>
        /// <value>
        /// The reference type identifier.
        /// </value>
        public int RefTypeId { get; set; }
        
        /// <summary>
        /// Gets or sets the reference no.
        /// </summary>
        /// <value>
        /// The reference no.
        /// </value>
        public string RefNo { get; set; }
         /// <summary>
        /// Gets or sets the reference no.
        /// </summary>
        /// <value>
        /// The reference no.
        /// </value>
        public string TaxCode { get; set; } 

           /// <summary>
        /// Gets or sets the reference no.
        /// </summary>
        /// <value>
        /// The reference no.
        /// </value>
        public string Trader { get; set; } 

        /// <summary>
        /// Gets or sets the reference date.
        /// </summary>
        /// <value>
        /// The reference date.
        /// </value>
        public DateTime RefDate { get; set; }

        /// <summary>
        /// Gets or sets the customer identifier.
        /// </summary>
        /// <value>
        /// The customer identifier.
        /// </value>
        public int? CustomerId { get; set; }

        /// <summary>
        /// Gets or sets the vendor identifier.
        /// </summary>
        /// <value>
        /// The vendor identifier.
        /// </value>
        public int? VendorId { get; set; }


        
        /// <summary>
        /// Gets or sets the StockId.
        /// </summary>
        /// <value>
        /// The StockId.
        /// </value>
        public int  StockId { get; set; }

        /// <summary>
        /// Gets or sets the amount.
        /// </summary>
        /// <value>
        /// The amount.
        /// </value>
        public Decimal TotalAmountOc { get; set; }

          /// <summary>
        /// Gets or sets the amount.
        /// </summary>
        /// <value>
        /// The amount.
        /// </value>
        public Decimal TotalAmountTax { get; set; } 

        
        /// <summary>
        /// Gets or sets the journal memo.
        /// </summary>
        /// <value>
        /// The journal memo.
        /// </value>
        public string JournalMemo { get; set; }

        /// <summary>
        /// Gets or sets the document include.
        /// </summary>
        /// <value>
        /// The document include.
        /// </value>
        public string DocumentInclude { get; set; }

        /// <summary>
        /// Gets or sets the object identifier.
        /// </summary>
        /// <value>
        /// The object identifier.
        /// </value>

        public IList<ItemTransactionDetail> ItemTransactionDetails { get; set; } 
    }
}
